MAININC = $(HOME)/csr-repository/include/
COMMON = $(HOME)/csr-repository/
CFLAGS_COMMON= -I$(COMMON) -I$(MAININC) -std=c++0x
# FLAGS for opencv
# -fPIC necessary to allow proper construction of shared library
LDFLAGS = -lstdc++ -pthread



#BUILD_TYPE=debug
BUILD_TYPE=release

ifeq ($(BUILD_TYPE), debug)
	CFLAGS = $(CFLAGS_COMMON)
endif
ifeq ($(BUILD_TYPE), release)
	# -O3 tells the compiler to optimize which takes more time, however the code is about 50% faster
	CFLAGS = $(CFLAGS_COMMON) -O3
endif


OFILES= protomaster.o 
TARGETS= $(HOME)/proto $(OFILES)

all: $(TARGETS)


protomaster.o: protomaster.cpp
	gcc -std=c++0x -g $(CFLAGS) -c  $< -o $@ 

$(HOME)/proto: $(OFILES)
	gcc  -o $(HOME)/proto $(OFILES) $(LDFLAGS)



clean:	
	rm -f *.o
	rm -f *.d
